# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Sergej Pupykin <pupykin.s+aur@gmail.com>

pkgname=perl-gd
pkgver=2.76
pkgrel=1
pkgdesc="Interface to Gd Graphics Library"
arch=('loong64' 'x86_64')
url="https://search.cpan.org/dist/GD"
license=('GPL' 'PerlArtistic')
depends=('perl' 'gd')
makedepends=('perl-extutils-pkgconfig')
options=('!emptydirs')
source=(https://search.cpan.org/CPAN/authors/id/R/RU/RURBAN/GD-$pkgver.tar.gz)
sha512sums=('31c2d61440a7fef9804aed677ee5568f6c237e678cf5a2b7f48e98326ef7cddbf3624ce3965e6711ef9cec4148881a0cb4352c19b91ead4b78835fafaeefbe4d')

build() {
  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL="--skipdeps" \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='"$pkgdir"'" \
    PERL_MB_OPT="--installdirs vendor --destdir '"$pkgdir"'" \
    MODULEBUILDRC=/dev/null

  cd  "$srcdir"/GD-$pkgver
  perl Makefile.PL
  make
}

package() {
  cd  "$srcdir"/GD-$pkgver
  make install
}
